var originArrMethods = Array.prototype;
var arrMethods = Object.create(originArrMethods);

// 不可以直接替换Array.prototype上的方法，会导致影响全局

ARR_METHODS.map(function (m) {
  arrMethods[m] = function () {
    var args = Array.prototype.slice.call(arguments),
      rt = originArrMethods[m].apply(this, args);
    var newArr;
    switch (m) {
      case "push":
      case "unshift":
        newArr = args;
        break;
      case "splice":
        newArr = args.slice(2);
        break;
      default:
        break;
    }
    newArr && arrDep.notify();
  };
});
var arrDep;
function arrayNotify(dep) {
  arrDep = dep;
}
